import frappe


def get_context(context):
    preferred = (frappe.local.lang or frappe.get_system_settings("language") or "zh").lower()
    current = "zh" if preferred.startswith("zh") else "en"
    context.current_language = current
    return context

